A tracing framework is a collection of software routines and tools that permit a user to instrument and record the activity of one or more executing programs, including an operating system kernel. Tracing frameworks typically permit users to describe instrumentation requests by naming one or more probes, which are locations of interest that can be used as data-recording sites within an instrumented program. Tracing frameworks also permit users to associate these probes with one or more actions. The actions describe what tracing operations should be performed when the executing instrumented program passes through the probe site (i.e., when a probe triggers). Tracing frameworks typically provide either a defined set of actions at each probe, a set of user-selectable actions, or the ability to execute an essentially arbitrary set of actions composed in a programming language (such as C, C++, or Pascal).
In tracing frameworks that support a programming language for describing actions, tracing operations (in the form of language statements) are compiled into an intermediate form or directly into machine code. The tracing operations are executed when a probe triggers. In tracing frameworks that compile probe descriptions and actions from a programming language into an intermediate form, the compiler is typically implemented as a user application that then communicates the results of the compilation to the operating system kernel where the probe instrumentation is performed. Communication is typically performed using one or more system calls or device driver calls combined with a set of data structures that together form a binary interface between the trace program compiler and the tracing framework instrumentation service.
Because probes are locations of instrumentation within the executing instrumented program, the probes are associated with the implementation and an embodiment of the executing program. The tracing framework actions provide access to data memory associated with the instrumented program. The data memory is arranged into a set of implementation data structures associated with the internal implementation details and artifacts of the instrumented program.
A debugger is another tool that allows inspection of an instrumented program executing under complete or partial control of the debugger. A debugger is distinct from a tracing framework in that a debugger typically provides a mechanism whereby the instrumented program stops executing at instrumented locations of interest and then is inspected by a user of the debugger before subsequently continuing execution. In contrast, a tracing framework typically permits users to perform additional actions only while the instrumented program is executing. Examination of the results occurs after the execution is complete, or in parallel with execution of the instrumented program. Debuggers are similar to tracing frameworks in that both offer a facility whereby the user may view the data memory of the instrumented program and control the format and organization of the memory display.
Currently, any user may trace a program and gather information from the probes. The data traced at those probes may help the user understand the traced program's activity. Typically, probes are associated with specific points in the program's control flow (e.g., function entry, function return, individual machine instructions, etc.) or based on some asynchronous event stream (e.g., from a timer, other machine interrupts, etc.). Though these probes can provide extensive coverage of the traced program, effective use of them may require knowledge of the traced programs inner workings. Having a developer insert probes at specific locations in the traced program provides easily understood information to users tracing the program. The developer is in a unique position to decide the points of interest and their semantic meanings.